<div class="container">
  <div class="my_test">
    <div class="title ">我创建的测试
      <div class="add" (click)="addTest=true"></div>
    </div>
    <div class="class_list">
      <div class="setting" [ngClass]="{'setting1':isEdit}" nzTitle="设置" nzPlacement="topCenter" nz-tooltip
           (click)="isEdit=!isEdit"></div>
      <div class="change_look" nzTitle="改变查看方式" nzPlacement="topCenter" nz-tooltip (click)="showChangByMonth()"></div>
      <div *ngIf="!showChange" class="clearfix">
        <div class="class_test f_l" *ngFor="let classTraining of trainingOfClassGroups;let i =index">
          <div class="test clearfix customer-item-content" *ngFor="let training of classTraining;let j =index" (click)="jumpRoster(training)" >
            <div class="test_left f_l" >
              <div class="test_img"></div>
              <div class="invite_code" *ngIf="!training.codeEnd">
                <p>邀请码</p>
                {{training.inviteCode}}
              </div>
              <div class="invite_code" *ngIf="training.codeEnd" style="font-size: 12px;cursor: pointer;color:#d23e93;text-decoration: underline" (click)="createCode($event,training)">点击生成邀请码</div>
            </div >
            <div class="test_right f_l" >
              <div class="test_title">
                {{training.name}}
              </div>
              <p class="create_time" style="font-weight: bold">{{training.createTime|toDate|date:'yyyy年MM月dd日'}}</p>
              <div class="peoples">
                <img src="/assets/img/image/renshu.png" alt="" width="29" height="18" style="cursor: pointer">
                <span
                  style="display: inline-block;margin-left: 10px;line-height: 18px;vertical-align: middle">{{training.studentNum}}人</span>
              </div>
              <div class="edit_logo ">
                <img src="/assets/img/image/xiugai.png" alt="" width="20" height="21"
                     style="cursor: pointer;margin-right: 6px" *ngIf="isEdit" (click)="modifyByTraining(training)">
                <img src="/assets/img/image/shanchu.png" alt="" width="20" height="21" style="cursor: pointer"
                     *ngIf="isEdit" (click)="deleteTraining(training,classNames[i],i,j)">
                <p class="className" *ngIf="!isEdit">{{classNames[i]}}</p>
              </div>
            </div>
          </div>
          <div class="show_more">
            <span>{{classNames[i]}}</span>
            <div class="minute_logo" (click)="jumpMinuteByClass(trainingOfClassGroups[i][0].classGuid,classNames[i])">...</div>
          </div>
        </div>
        <!--匿名测试-->
        <div class="class_test f_l">
          <div class="test clearfix customer-item-content" *ngFor="let training of showBilendTrainingList;let i =index" (click)="jumpRoster(training)">
            <div class="test_left f_l">
              <div class="test_img"></div>
              <div class="invite_code" *ngIf="!training.codeEnd">
                <p>邀请码</p>
                {{training.inviteCode}}
              </div>
              <div class="invite_code" *ngIf="training.codeEnd" style="font-size: 12px;cursor: pointer;color:#d23e93;text-decoration: underline" (click)="createCode($event,training)">点击生成邀请码</div>
            </div>
            <div class="test_right f_l">
              <div class="test_title">
                {{training.name}}
              </div>
              <p class="create_time" style="font-weight: bold">{{training.createTime|toDate|date:'yyyy年MM月dd日'}}</p>
              <div class="peoples">
                <img src="/assets/img/image/renshu.png" alt="" width="29" height="18" style="cursor: pointer">
                <span
                  style="display: inline-block;margin-left: 10px;line-height: 18px;vertical-align: middle">{{training.studentNum}}人</span>
              </div>
              <div class="edit_logo ">
                <img src="/assets/img/image/xiugai.png" alt="" width="20" height="21"
                     style="cursor: pointer;margin-right: 6px" *ngIf="isEdit" (click)="modifyByTraining(training)">
                <img src="/assets/img/image/shanchu.png" alt="" width="20" height="21" style="cursor: pointer"
                     *ngIf="isEdit" (click)="deleteTrainingByBlind(training,i)">
                <p class="className" *ngIf="!isEdit">匿名测试</p>
              </div>
            </div>
          </div>
          <div class="show_more">
            <span>其他测试</span>
            <div class="minute_logo" (click)="jumpMinuteByClass(null,null)">...</div>
          </div>
        </div>
      </div>
      <!--按月份来查看-->
      <div class="month_test_list" *ngIf="showChange">
        <div class="month_list" *ngFor="let monthTrainings of trainingByMonthGroups;let i =index">
          <div class="month_line">
            <div class="month_circle">{{monthList[i]}}</div>
          </div>
          <div class="test_list" *ngIf="monthTrainings.length>=1">
            <ul class="clearfix">
              <li class="f_l customer-item-content" *ngFor="let training of monthTrainings;let j = index" (click)="jumpRoster(training)">
                <div class="test">
                  <div class="test_left f_l">
                    <div class="test_img"></div>
                    <div class="invite_code" *ngIf="!training.codeEnd">
                      <p>邀请码</p>
                      {{training.inviteCode}}
                    </div>
                    <div class="invite_code" *ngIf="training.codeEnd" style="font-size: 12px;cursor: pointer;color:#d23e93;text-decoration: underline" (click)="createCode($event,training)">点击生成邀请码</div>
                  </div>
                  <div class="test_right f_l">
                    <div class="test_title">
                      {{training.name}}
                    </div>
                    <p class="create_time" style="font-weight: bold">
                      {{training.createTime|toDate|date:'yyyy年MM月dd日'}}</p>
                    <div class="peoples">
                      <img src="/assets/img/image/renshu.png" alt="" width="29" height="18" style="cursor: pointer">
                      <span
                        style="display: inline-block;margin-left: 10px;line-height: 18px;vertical-align: middle">{{training.studentNum}}人</span>
                    </div>
                    <div class="edit_logo">
                      <img src="/assets/img/image/xiugai.png" alt="" width="20" height="21"
                           style="cursor: pointer;margin-right: 6px" *ngIf="isEdit" (click)=" modifyTrainingByMonth(training,i,j)">
                      <img src="/assets/img/image/shanchu.png" alt="" width="20" height="21" style="cursor: pointer"
                           *ngIf="isEdit" (click)="deleteTrainingByMonth(training,i,j)">
                      <p class="className" *ngIf="!isEdit">{{training.className?training.className:'匿名测试'}}</p>
                    </div>
                  </div>
                </div>
              </li>
            </ul>
          </div>
          <div class="no_tip" *ngIf="!monthTrainings.length>=1">本月您并没有创建任何测试哟</div>
        </div>
        <div class="month_list" >
          <div class="month_line">
            <div class="month_circle_earlier" (click)="getLastMonth()">更早</div>
          </div>
          <div class="more_tip" >←点击查看更多测试</div>
        </div>
      </div>
    </div>
  </div>
  <!--回收站-->
  <div class="recycle_bin">
    <div class="title">回收站<span><i style="cursor: pointer" (click)="deleteStatus=!deleteStatus">"{{deleteStatus?'展开':'折叠'}}"</i> 所有删除测试</span></div>
    <div *ngIf="!deleteStatus">
    <div class="delete_setting" [ngClass]="{'setting1':deleteIsEdit}" nzTitle="设置" nzPlacement="topCenter" nz-tooltip
         (click)="deleteIsEdit=!deleteIsEdit"></div>
    <div class="delete_test_list">
      <ul class="clearfix">
        <li class="f_l customer-item-content" *ngFor="let training of deleteTrainingList;let i =index;" (click)="jumpRoster(training)">
          <div class="test">
            <div class="test_left f_l">
              <div class="test_img gray"></div>
              <div class="invite_code" style="color: #BFBFBF">
                <p style="color: #BFBFBF">邀请码</p>
                {{training.codeEnd?'已删除':training.inviteCode}}
              </div>
            </div>
            <div class="test_right f_l">
              <div class="test_title">
                {{training.name}}
              </div>
              <p class="create_time" style="font-weight: bold">{{training.createTime|toDate|date:'yyyy年MM月dd日'}}</p>
              <div class="peoples">
                <img src="/assets/img/image/renshu.png" alt="" width="29" height="18" style="cursor: pointer">
                <span
                  style="display: inline-block;margin-left: 10px;line-height: 18px;vertical-align: middle">{{training.studentNum}}人</span>
              </div>
              <div class="edit_logo ">
                <img src="/assets/img/image/huifu.png" alt="" width="20" height="21" style="cursor: pointer;"
                     *ngIf="deleteIsEdit" (click)="recoverTraining(training,i)">
                <p class="className " *ngIf="!deleteIsEdit">{{training.className?training.className:'匿名测试'}}</p>
              </div>
            </div>
          </div>
        </li>
      </ul>
    </div>
    </div>
  </div>
</div>
<!--添加新的测试-->
<app-add-test
  *ngIf="addTest"
  (onCloseAdd)="onCloseAdd($event)"
  [userGuid]="userGuid"
  [training]="modifyTraining"
>
</app-add-test>
